import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import InfoEntry from '../views/InfoEntry.vue'
import Success from '../views/Success.vue'
import Errors from '../views/Errors.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    redirect: '/info_entry',
    meta: {
      requireAuth: false, // 是否需要登录
      routerName: "入口"
    }
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    meta: {
      requireAuth: false,
      routerName: "无证入住"
    }
  },
  {
    path: '/info_entry',
    name: 'info_entry',
    component: InfoEntry,
    meta: {
      requireAuth: false,
      routerName: "无证入住登记"
    }
  },
  {
    path: '/success',
    name: 'success',
    component: Success,
    meta: {
      requireAuth: false,
      routerName: "无证入住成功"
    }
  },
  {
    path: '/errors',
    name: 'errors',
    component: Errors,
    meta: {
      requireAuth: false,
      routerName: "无证入住错误"
    }
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router